<!DOCTYPE html>
<html lang="zh">

	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<meta http-equiv="X-UA-Compatible" content="ie=edge" />
		<title>Document</title>
	</head>

	<body>

		<div class="answer-main">
			<ul>
				<li class="children-s">
					<div><span>纸张：</span>
						<select name="" class="pageType">
							<option value="a3">A3</option>
							<option value="a4" selected="selected">A4</option>
							<option value="b4">B4</option>
							<option value="b5">B5</option>
						</select>
					</div>
					<div><span>页数：</span>
						<select name="" value="2" class="pageNum">
							<option value="1">1</option>
							<option value="2" selected="selected">2</option>
							<option value="3">3</option>
							<option value="4">4</option>
							<option value="5">5</option>
							<option value="6">6</option>
						</select>
					</div>
					<div><span>栏数：</span>
						<select name="" class="pageSubfield">
							<option value="1">1</option>
							<option value="2">2</option>
							<option value="3">3</option>
						</select>
					</div>
				</li>
				<li class="children-s">
					<div><span>颜色：</span>
						<select name="" class="colorType">
							<option value="red">红色</option>
							<option value="balck">黑色</option>
						</select>
					</div>
					<div><span>考号样式：</span>
						<select name="" class="idStyle">
							<option value="1">条码</option>
							<option value="2" selected="selected">填涂</option>

						</select>
					</div>
					<div><span>考号长度：</span><input type="text" style="width:60px;" class="idLength"></div>
				</li>
				<li class="check-li children-s">
					<div>
						<label for="slideLine">侧边密封线</label>
						<input type="checkbox" name="" id="slideLine">
					</div>
					<div>
						<label for="handinput">手写分数框</label>
						<input type="checkbox" name="" id="handinput">
					</div>
				</li>
				<li class="children-one">
					<span>标题：     &nbsp;&nbsp;</span><input type="text" class="sheetTitleVal">
				</li>
				<li class="children-one">
					<span>副标题：</span><input type="text" class="subTitle">
				</li>
			</ul>
		</div>

		<div class="btn-box">
			<input class="save" type="button" value="保存" id="save">
			<input class="cancel" type="button" value="取消" id="cancel">
		</div>

		<link rel="stylesheet" type="text/css" href="../css/answerCardPublic.css" />
		<link rel="stylesheet" type="text/css" href="../css/index.css" />
		<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
		<script type="text/javascript">
			var index = parent.layer.getFrameIndex(window.name)
			$('#save').on('click', function() {
				var obj = {};
				obj.pageType = $('.pageType').val(); //纸张类型
				obj.pageNum = $('.pageNum').val(); //页数
				obj.pageSubfield = $('.pageSubfield').val(); //分栏
				obj.colorType = $('.colorType').val(); //颜色
				obj.idStyle = $('.idStyle').val(); //考号样式
				obj.idLength = $('.idLength').val(); //考号长度
				obj.slideLine = $('#slideLine').prop('checked'); //侧边密封线
				obj.handinput = $('#handinput').prop('checked'); //手写分数框
				obj.sheetTitleVal = $('.sheetTitleVal').val(); //标题
				obj.subTitle = $('.subTitle').val(); //副标题

				if(obj.idLength > 0 && obj.idLength <= 18) {

				} else {
					parent.layer.open({
						offset: '150px',
						type: 0,
						content: '数据未填写完成，不可创建模板',
					})
					return
				}
				if(obj.pageType && obj.pageNum && obj.pageSubfield && obj.colorType && obj.idStyle && obj.idLength && obj.sheetTitleVal && obj.subTitle) {
					parent.layer.close(index);
					parent.location.href = '../sheet.html?pageType=' + obj.pageType + '&pageNum=' + obj.pageNum + '&pageSubfield=' + obj.pageSubfield + '&colorType=' + obj.colorType + '&idStyle=' + obj.idStyle + '&idLength=' + obj.idLength + '&slideLine=' + obj.slideLine + '&handinput=' + obj.handinput + '&sheetTitleVal=' + obj.sheetTitleVal + '&subTitle=' + obj.subTitle;
				} else {
					//			alert('数据未填写完成，不可创建模板')
					layer.msg('数据未填写完成，不可创建模板')
				}
			})
			$('#cancel').on('click', function() {
				parent.layer.close(index);
				debugger
				parent.location.href='../sheet.html';
			})
		</script>
	</body>

</html>